Process Raw Text for Knowledge Base
Processes raw text input and adds it to the knowledge base for the specified agent.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/kb/text |
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/kb/text' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "YOUR_AGENT_ID",
"text": "This is the raw text content to be added to the knowledge base."
}'
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data type, must be application/json. |
Request Body
Request Body Schema
{
"agent_id": "string",
"text": "string"
}
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Yes | The unique identifier of the AI agent. |
| text | string | Yes | The raw text content to be processed. |
Response
Success Response (200 OK)
Returns an object containing the processing status and details.
{
"is_success": true,
"knowledge_id": "kb_abc123",
"detail": "Text processed successfully",
"error": {}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the text processing was successful. |
| knowledge_id | string | Unique identifier for the created knowledge entry. |
| detail | string | Success or failure message with additional context. |
| error | object | Error details if the operation failed (empty if successful). |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request body is invalid.
{
"detail": [
{
"loc": [
"body",
"agent_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |